package com.simtop.service.impl;

import com.simtop.domain.LeaveWord;
import com.simtop.mapper.LeaveWordMapper;
import com.simtop.service.LeaveWordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author lvyongwei
 */
@Service
public class LeaveWordServiceImpl implements LeaveWordService {

    @Autowired
    private LeaveWordMapper leaveWordMapper;

    /**
     * 添加留言信息
     * @param leaveWord
     * @return
     */
    @Override
    public boolean insertLeaveWord(LeaveWord leaveWord) {
        leaveWord.setCreateTime(new Date());
        return leaveWordMapper.insertLeaveWord(leaveWord);
    }

    /**
     * 获取留言信息
     * @param leaveWord
     * @return
     */
    @Override
    public List<LeaveWord> getAllLeaveWord(LeaveWord leaveWord) {
        return leaveWordMapper.getAllLeaveWord(leaveWord);
    }

    /**
     * 批量删除
     * @param ids
     * @return
     */
    @Override
    public boolean deleteLeaveWord(List<Long> ids) {
        return leaveWordMapper.deleteLeaveWord(ids);
    }
}
